package com.ruoyi.business.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * APP用户对象 jt_app_user
 * 
 * @author Alan Zhang
 * @date 2025-03-31
 */
public class JtAppUser extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 用户id */
    private Long userId;

    /** 系统用户id */
    @Excel(name = "系统用户id")
    private Long sysUserId;

    /** 用户昵称 */
    @Excel(name = "用户昵称")
    private String userName;

    /** 国家码 */
    @NotNull
    @Excel(name = "国家码")
    private Integer countryCode;

    /** 电话 */
    @Excel(name = "电话")
    @NotNull
    @Size(min = 5, max = 12, message = "长度不能超过5-12个字符")
    private String phoneNumber;

    /** 邮箱 */
    @Email(message = "邮箱格式不正确")
    @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
    @Excel(name = "邮箱")
    private String email;

    /** 头像路径 */
    @Excel(name = "头像路径")
    private String avatar;

    /** 密码 */
    @Excel(name = "密码")
    private String password;

    /** 盐加密 */
    @Excel(name = "盐加密")
    private String salt;

    /** 推广码 */
    @Excel(name = "推广码")
    private String promotionCode;

    /** 推广积分 */
    @Excel(name = "推广积分")
    private Integer promotionPoint;

    /** 佣金 */
    @Excel(name = "佣金")
    private BigDecimal commission;

    /** 账号状态（0正常 1停用） */
    @Excel(name = "账号状态", readConverterExp = "0=正常,1=停用")
    private Integer status;

    /** 用户身份（1普通用户 2分销商） */
    @Excel(name = "用户类型", readConverterExp = "1=普通用户,2=分销商")
    private Integer userType;

    /** 申请状态（0待申请 1已申请） */
    @Excel(name = "申请状态", readConverterExp = "0=待申请,1=已申请")
    private Integer applyStatus;

    /** 最后登录IP */
    @Excel(name = "最后登录IP")
    private String loginIp;

    /** 最后登录时间 */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date loginDate;

    /** 密码最后更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "密码最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date pwdUpdateDate;

    /** 用户语言 */
    @Excel(name = "用户语言")
    private String lang;

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public void setSysUserId(Long sysUserId) 
    {
        this.sysUserId = sysUserId;
    }

    public Long getSysUserId() 
    {
        return sysUserId;
    }

    public void setUserName(String userName) 
    {
        this.userName = userName;
    }

    public String getUserName() 
    {
        return userName;
    }

    public void setCountryCode(Integer countryCode)
    {
        this.countryCode = countryCode;
    }

    public Integer getCountryCode()
    {
        return countryCode;
    }

    public void setPhoneNumber(String phoneNumber) 
    {
        this.phoneNumber = phoneNumber;
    }

    public String getPhoneNumber() 
    {
        return phoneNumber;
    }

    public void setEmail(String email) 
    {
        this.email = email;
    }

    public String getEmail() 
    {
        return email;
    }

    public void setAvatar(String avatar) 
    {
        this.avatar = avatar;
    }

    public String getAvatar() 
    {
        return avatar;
    }

    public void setPassword(String password) 
    {
        this.password = password;
    }

    public String getPassword() 
    {
        return password;
    }

    public void setSalt(String salt) 
    {
        this.salt = salt;
    }

    public String getSalt() 
    {
        return salt;
    }

    public void setPromotionCode(String promotionCode) 
    {
        this.promotionCode = promotionCode;
    }

    public String getPromotionCode() 
    {
        return promotionCode;
    }

    public void setPromotionPoint(Integer promotionPoint) 
    {
        this.promotionPoint = promotionPoint;
    }

    public Integer getPromotionPoint() 
    {
        return promotionPoint;
    }

    public void setCommission(BigDecimal commission) 
    {
        this.commission = commission;
    }

    public BigDecimal getCommission() 
    {
        return commission;
    }

    public void setStatus(Integer status) 
    {
        this.status = status;
    }

    public Integer getStatus() 
    {
        return status;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public void setApplyStatus(Integer applyStatus)
    {
        this.applyStatus = applyStatus;
    }

    public Integer getApplyStatus() 
    {
        return applyStatus;
    }

    public void setLoginIp(String loginIp) 
    {
        this.loginIp = loginIp;
    }

    public String getLoginIp() 
    {
        return loginIp;
    }

    public void setLoginDate(Date loginDate) 
    {
        this.loginDate = loginDate;
    }

    public Date getLoginDate() 
    {
        return loginDate;
    }

    public Date getPwdUpdateDate() {
        return pwdUpdateDate;
    }

    public void setPwdUpdateDate(Date pwdUpdateDate) {
        this.pwdUpdateDate = pwdUpdateDate;
    }

    public String getLang() {
        return lang;
    }

    public void setLang(String lang) {
        this.lang = lang;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("userId", getUserId())
            .append("sysUserId", getSysUserId())
            .append("userName", getUserName())
            .append("countryCode", getCountryCode())
            .append("phoneNumber", getPhoneNumber())
            .append("email", getEmail())
            .append("avatar", getAvatar())
            .append("password", getPassword())
            .append("salt", getSalt())
            .append("promotionCode", getPromotionCode())
            .append("promotionPoint", getPromotionPoint())
            .append("commission", getCommission())
            .append("status", getStatus())
            .append("userType", getUserType())
            .append("applyStatus", getApplyStatus())
            .append("loginIp", getLoginIp())
            .append("loginDate", getLoginDate())
            .append("pwdUpdateDate", getPwdUpdateDate())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
